package com.cb.common.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class CommonUtil {
	
	/**
	 * 判断字符串是否含有中文字
	 * @param source
	 * @return true=是 false=否
	 */
	public static Boolean strHasChinese(String source){
		Pattern reg=Pattern.compile("^[\\u4e00-\\u9fa5]$");
		Boolean result=false;
		for(char c:source.toCharArray()){
			Matcher matcher=reg.matcher(String.valueOf(c));
			if(matcher.find()){
				result= true;
				break;
			}
		}
		return result;
	}
}
